package com.atguigu.spzx.cloud.user.service.impl;

import com.alibaba.csp.sentinel.annotation.SentinelResource;
import com.atguigu.spzx.cloud.user.entity.User;
import com.atguigu.spzx.cloud.user.mapper.UserMapper;
import com.atguigu.spzx.cloud.user.service.UserService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl extends ServiceImpl<UserMapper,User> implements UserService {

    @Autowired
    private UserMapper userMapper ;

    @Override
    public User findUserByUserId(Long userId) {
        return userMapper.findUserByUserId(userId);
    }


    @SentinelResource("users") //默认： sentinel不识别service 认controller方法
    public void queryUsers(){
        System.err.println("查询用户");
    }
}